package com.baomidou.springwind.enums;

import com.baomidou.springwind.entity.*;
import com.baomidou.springwind.excel.*;

public enum FileTypeEnum {

    RESOURCE(1, "资源数据", ResourceDataReader.class),
    MATERIEL(3, "物料数据", MaterielDataReader.class),
    RECEIVE(4, "入库数据", RecieveDataReader.class),
    DELIVERY(5, "出库数据", DeliveryDataReader.class),
    NETWORK(6, "网络数据", NetworkDataReader.class),
    WORKTIME(8, "作业时间", WorkTimeDataReader.class),
    WEEKOEDER(10,"周订单数据", WeekOrderDataReader.class),
    FLOWANALYSIS(11,"物流量分析",FlowAnalysisDataReader.class),
    DEPARTMENTSHANGER(12,"科室数量",DepartmentsHangerDataReader.class),
    NETWORKSUPPLY(13,"网络供应链",NetworkSupplyDataReader.class),
    NETWORKDELIVERY(14,"网络供应配送中心",NetworkDeliveryDataReader.class),
    ORDERDATA(15,"库存持有成本",OrderDataDataReader.class),
    NETWORKPLANNING(16,"网络第一个算法结果",NetworkPlanningDataReader.class),
    INVENTORYCOSTAFTER(18,"库存持有成本优化后",InventoryCostAfterDataReader.class),
    CITYORDER(19,"城市配送订单数据",CityOrderDataReader.class),
    NETWORKTRANSPORTPROPERTY(20,"网络规划运输费率",TransportPropertyDataReader.class),
    NETWORKCANDIDATE(21,"物流网络规划备选点",NetworkCandidateDataReader.class);

    public final int value;
    public final String desc;
    public final Class<? extends ExcelReader> handler;

    FileTypeEnum(final int value, final String desc, Class handler) {
        this.value = value;
        this.desc = desc;
        this.handler = handler;
    }

    /**
     * 根据value值获取枚举对象
     *
     * @param value
     * @return
     */
    public static FileTypeEnum valueOf(int value) {
        FileTypeEnum[] instances = FileTypeEnum.values();
        for (FileTypeEnum instance : instances) {
            if (instance.value == value) {
                return instance;
            }
        }
        throw new RuntimeException("value=" + value + "transform to PromotionApplyDefValueEnum failed!");
    }
}
